package org.kyw.system.service.impl;

import org.kyw.basic.service.impl.BaseServiceImpl;
import org.kyw.system.domain.SystemDictionaryType;
import org.kyw.system.mapper.SystemDictionaryDetailMapper;
import org.kyw.system.mapper.SystemDictionaryTypeMapper;
import org.kyw.system.service.ISystemDictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class SystemDictionaryTypeServiceImpl extends BaseServiceImpl<SystemDictionaryType> implements ISystemDictionaryTypeService {

    @Autowired
    private SystemDictionaryDetailMapper systemDictionaryDetailMapper;
    @Autowired
    private SystemDictionaryTypeMapper systemDictionaryTypeMapper;

    @Override
    @Transactional
    public void remove(Long id) {
        systemDictionaryDetailMapper.deleteByTypeId(id);
        systemDictionaryTypeMapper.delete(id);
    }
}
